﻿using System;
using System.Collections.Generic;
using Epon.EponEl5600.Core;

namespace Epon.EponEl5600.ViewModel
{
    public class SystemModelViewModel : BaseViewModel<SystemModel>, IDataProcessing
    {
        private static readonly Dictionary<string, string> InitDic = new Dictionary<string, string>
                {
                    { "SysObjectId",".1.3.6" },
                    { "SysUpTime","0d 0h 0m 0s" },
                    { "SoftwareVersion","Ver 1.0" },
                    { "HardwareVersion","Ver 1.0" },
                    { "BootromVersion","Ver 1.0" },
                    { "SysContact","Lootom" },
                    { "SysName","Lootom Epon" },
                    { "SysLocation","local" }
                };

        private SystemModel _systemModel;

        public string SysObjectId
        {
            get { return _systemModel.SysObjectId; }
            set { SetPropertyValue("SysObjectId", value); }
        }

        public string SysUpTime
        {
            get { return Value.SysUpTime; }
            set { SetPropertyValue("SysUpTime", value); }
        }

        public string SoftwareVersion
        {
            get { return Value.SoftwareVersion; }
            set { SetPropertyValue("SoftwareVersion", value); }
        }

        public string HardwareVersion
        {
            get { return Value.HardwareVersion; }
            set { SetPropertyValue("HardwareVersion", value); }
        }

        public string BootromVersion
        {
            get { return Value.BootromVersion; }
            set { SetPropertyValue("BootromVersion", value); }
        }

        public string SysContact
        {
            get { return Value.SysContact; }
            set { SetPropertyValue("SysContact", value); }
        }

        public string SysName
        {
            get { return Value.SysName; }
            set { SetPropertyValue("SysName", value); }
        }

        public string SysLocation
        {
            get { return Value.SysLocation; }
            set { SetPropertyValue("SysLocation", value); }
        }

        public SystemModelViewModel()
        {
            _systemModel = new SystemModel();
            Init();
        }

        public void Init()
        {
            foreach (var kvp in InitDic)
            {
                SetPropertyValue(kvp.Key, kvp.Value);
            }
        }

        public string ProcessingSign
        {
            get { return "Sys_"; }
        }

        public void UpDateValue(KeyValuePair<string, string> kvp)
        {
            throw new NotImplementedException();
        }
    }
}
